﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using HiLand.Utility.Web;
using GBFinance.Web.Models;

namespace GBFinance.Web.Controllers
{
    public class TestController : Controller
    {
        //
        // GET: /Test/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult ControlTest()
        {
            return View();
        }

        public ActionResult CookieTest()
        {
            LoanCookie cookie = new LoanCookie();
            cookie.Load();
            this.ViewData["CurrentStep"] = cookie.CurrentStep;
            return View();
        }

        [HttpPost]
        public ActionResult CookieTest(bool? onlyPlaceHolder)
        {
            LoanCookie cookie = new LoanCookie();

            cookie.CurrentStep = 1;
            cookie.Save();
            this.ViewData["CurrentStep"] = cookie.CurrentStep;
            return View();
        }

        public ActionResult DisplayControllerName()
        {
            return View();
        }


        public ActionResult ValidateTest()
        {
            this.ViewData["Status"] = "Get";
            return View();
        }

        [HttpPost]
        public ActionResult ValidateTest(string myInput)
        {
            return Json(myInput);
        }

        public ActionResult ValidateTestResult(string myInput)
        {
            this.ViewData["Status"] = "Post";
            this.ViewData["MyInput"] = myInput;
            return View();
        }
    }
}
